public class Factorials	{
	public static void main(String[] args)	{
		for (long i=1; i<=10; i++)
			System.out.println(i + "! = " + factors(i));
	}

	static long factors(long a)	{
		long result = 1;

		for (long i=1; i<=a; i++)
			result *= i;
		return result;
	}
}
